# == Schema Information
#
# Table name: sale_records
#
#  id            :integer          not null, primary key
#  name          :string
#  mobile        :string
#  address       :string
#  purchase_date :datetime
#  product_no    :string
#  created_at    :datetime         not null
#  updated_at    :datetime         not null
#  demand        :string
#  state         :boolean          default(FALSE)
#

class SaleRecord < ApplicationRecord
  validates :name, presence: true
  validates :mobile, :presence => true, :format => {:with => /\A1\d{10}\z/, :message => '请输入正确的手机号码'}#, :if => :is_not_third_party_account?
  validates :address, presence: true
end
